package models;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import play.db.jpa.Model;

@Entity
@Table(name = "Day_Tasks", uniqueConstraints = { @UniqueConstraint(columnNames = {
		"day_id", "task_id" }) })
public class DayTask extends Model {

	@Column(name = "actual_effort")
	public double actualEffort;

	@ManyToOne
	@JoinColumn(name = "day_id")
	public Day day;

	@ManyToOne
	@JoinColumn(name = "task_id")
	public Task task;

	/**
	 * constructs a new ComponentUser object.
	 * 
	 * @param isMember
	 * @param user
	 * @param component
	 */
	public DayTask(double actualEffort, Task task, Day day) {
		super();
		this.day = day;
		this.task = task;
		this.actualEffort = actualEffort;
	}

}
